Controller support apparatus, controller support program executed on the apparatus, storage medium storing the program, and method of estimating execution time of control program

ABSTRACT

A controller support program causes a processor to acquire a first control execution time which is an execution time of a first control program which is an object program generated from a control source program, which is a source program of a control program generated in accordance with an object of control of a user, and operating at the simulator, the first control execution time being measured at the simulator. The processor also calculates an estimated execution time which is an estimated value of an execution time, at the controller, of a second control program which is an object program generated from the control source program and operating at the controller, by converting the first control execution time using the calibration data. Data representing the estimated execution time is output.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a continuation application of PCT/JP2011/056770 filed Mar. 22,2011, designating the United States of America, the disclosure of which,including the specification, drawings, and claims, is incorporated byreference in its entirety. The disclosure of Japanese Patent ApplicationNo. 2011-056775 filed Mar. 15, 2011, including the specification,drawings, and claims is expressly incorporated herein by reference inits entirety.

FIELD OF DISCLOSURE

The present disclosure relates to estimation of the execution time of acontrol program on a controller support apparatus for supporting use ofa controller such as PLC (Programmable Logic Controller, also referredto as “programmable controller”) that is used for controlling operationsof machinery or equipment, for example.

BACKGROUND INFORMATION

Controllers used for controlling operations of machinery, equipment, orthe like include general-purpose PLCs, and program control controllersdedicated to individual machines, for example.

A PLC is configured from, for example, a plurality of units such as aCPU (Central Processing Unit) unit that includes a microprocessor forexecuting control programs, and an IO (Input/Output) unit that handlessignal inputs from an external switch or a sensor and signal outputs toan external relay device or an actuator. The PLC executes controloperation while exchanging data through a PLC system bus and/or a fieldnetwork between the units for each control program execution cycle.

The controller support apparatus is used for generating various types ofsetting information for control programs to be executed by a controlleror for the controller, and transferring the setting information to thecontroller. The controller support apparatus is configured by, forexample, installing a controller support program on a general-purposecomputer. The controller support apparatus includes, for example, aneditor function of generating a source list of a control program, acompiler function of generating, from the source list of the controllerprogram, an object program that operates on a controller, a controllersimulator function of performing test execution of the control programat the controller support apparatus, and a function of communicatingwith the controller.

At the development stage of a control program, it is necessary to knowthe execution time required for the controller to execute the controlprogram. This execution time of the control program is referenced whensetting the interval of the execution cycle of the control program.Also, when setting mutually different execution priorities and executioncycle intervals for a plurality of control programs to be executed bythe controller, the execution time of each control program isreferenced.

In many cases, hardware and the operation system relating to executionof the control program differ between the controller support apparatusand the controller. Also, the execution code of the control program fora simulator may be different from that for a controller. Therefore, theexecution time of a control program executed by the simulator of thecontroller support apparatus may be different from the execution time ofthe control program executed by the controller.

JP 2001-209411A (Patent Document 1) discloses a method in which theexecution time required when a control program is executed by a PLC isobtained at a PLC support apparatus. Specifically, a method is disclosedin which actual process time data at the PLC for each command used inthe control program is prepared, and each time a command is processed ina program simulation execution process at a simulator, the actualprocess time data is referenced and the actual process timecorresponding to the command is accumulated.

PATENT DOCUMENTS

-   Patent Document 1: JP2001-209411A

Problem to be Solved by the Disclosure

Conventional PLCs employ, as the operation unit thereof, an ASIC(Application Specific Integrated Circuit) developed for executingcontrol programs, and many conventional PLCs have a configuration inwhich the ASIC executes execution code corresponding to a mnemoniccommand for PLC. Generally, commands used in PLC programming languagessuch as a ladder language can be converted into mnemonic commands forPLC on a one-to-one basis. In this case, as disclosed in Patent Document1, execution time of a control program could be obtained with a certainlevel of accuracy by using a method in which actual process time datafor each command is accumulated.

However, in recent years, general-purpose microprocessors are employedin a larger number of PLCs as the operation unit thereof due to improvedspeed. In such a case, a control program (source program) written in theladder language or other PLC programming language is executed by the PLCin a state complied into an object program that the microprocessor canexecute. According to experience of the inventors of the presentdisclosure, the actual process time at the microprocessor correspondingto each command in the PLC programming language is not necessarilyconstant due to influence of optimization of the object program, forexample. Therefore, with the method of accumulating the actual processtime data as described above, highly accurate estimated execution timecannot be obtained. In addition, if the control program uses a libraryof a function block or a special command, the execution time of thecalled library element fluctuates depending on the execution conditions,and thus execution time estimation accuracy is further deteriorated withthe method of accumulating actual process time data.

Under these circumstances, a method capable of estimating, at acontroller support apparatus, the execution time of a PLC (moregenerally called “controller”) that uses a general-purposemicroprocessor with higher accuracy is necessary. Of course, it ispreferable that the method also is applicable to execution timeestimation for controllers using the ASIC.

The present disclosure aims to estimate, in a controller supportapparatus, control program execution time at a controller with higheraccuracy.

SUMMARY OF THE DISCLOSURE

According to one aspect of the present disclosure, a controller supportapparatus includes a storage unit (a storage) and an operation unit (aprocessor or computer apparatus). The storage unit is used for storing acontroller support program and calibration data representing a relationbetween a first test execution time and a second test execution time.The first test execution time is an execution time of a first testprogram which is an object program generated from a test source programand operating at a simulator of a controller. The first test executiontime is measured at the simulator. The second test execution time is anexecution time of a second test program which is an object programgenerated from the test source program and operating at the controller.The second test execution time is measured at the controller. Thecontroller support program causes the operation unit to execute aprocess of acquiring a first control execution time which is anexecution time of a first control program which is an object programgenerated from a control source program, which is a source program of acontrol program generated in accordance with an object of control of auser, and operating at the simulator. The the first control executiontime is measured at the simulator. The controller support program alsocauses the operation unit to execute a process of calculating anestimated execution time which is an estimated value of an executiontime, at the controller, of a second control program which is an objectprogram generated from the control source program and operating at thecontroller, by converting the first control execution time using thecalibration data, and a execute a process for outputting datarepresenting the estimated execution time.

Preferably, the storage unit is further used for storing the firstcontrol program. The controller support program further causes theoperation unit to execute a process of causing the controller supportapparatus to function as the simulator and a process of measuring thefirst control execution time by executing the first control program atthe simulator.

More preferably, the controller support apparatus further includes adisplay unit (a display). The storage unit is further used for storingthe first test program and the second test execution time. Thecontroller support program further causes the operation unit to executea process of measuring the first test execution time by executing thefirst test program at the simulator, and a process of calculating thecalibration data from the first test execution time and the second testexecution time. The process for outputting data representing theestimated execution time is a process of generating display data forcausing the display unit to display the estimated execution time.

According to another aspect of the present disclosure, a controllersupport program to be executed by a controller support apparatusincluding a storage unit (a storage) and an operation unit (a processoror computer apparatus) is provided. The storage unit is used for storingthe controller support program and calibration data representing arelation between a first test execution time and a second test executiontime. The first test execution time is an execution time of a first testprogram which is an object program generated from a test source programand operating at a simulator of a controller. The first test executiontime is measured at the simulator. The second test execution time is anexecution time of a second test program which is an object programgenerated from the test source program and operating at the controller.The second test execution time is measured at the controller. Thecontroller support program causes the operation unit to execute aprocess of acquiring a first control execution time which is anexecution time of a first control program which is an object programgenerated from a control source program, which is a source program of acontrol program generated in accordance with an object of control of auser, and operating at the simulator. The first control execution timeis measured at the simulator. Also executed by the operation unit is aprocess of calculating an estimated execution time which is an estimatedvalue of an execution time, at the controller, of a second controlprogram which is an object program generated from the control sourceprogram and operating at the controller, by converting the first controlexecution time using the calibration data; and a process for outputtingdata representing the estimated execution time.

Preferably, the storage unit is further used for storing the firstcontrol program. The controller support program further causes theoperation unit to execute a process of causing the controller supportapparatus to function as the simulator, and a process of measuring thefirst control execution time by executing the first control program atthe simulator.

More preferably, the storage unit is further used for storing the firsttest program and the second test execution time. The controller supportprogram further causes the operation unit to execute: a process ofmeasuring the first test execution time by executing the first testprogram at the simulator, and a process of calculating the calibrationdata from the first test execution time and the second test executiontime.

According to still another aspect of the present disclosure, a storagemedium storing a controller support program to be executed by acontroller support apparatus includes a storage unit (storage) and anoperation unit (processor or computer apparatus). The storage unit isused for storing the controller support program and calibration datarepresenting a relation between a first test execution time and a secondtest execution time. The first test execution time is an execution timeof a first test program which is an object program generated from a testsource program and operating at a simulator of a controller. The firsttest execution time is measured at the simulator. The second testexecution time is an execution time of a second test program which is anobject program generated from the test source program and operating atthe controller. The second test execution time is measured at thecontroller. The controller support program causes the operation unit toexecute a process of acquiring a first control execution time which isan execution time of a first control program which is an object programgenerated from a control source program, which is a source program of acontrol program generated in accordance with an object of control of auser, and operating at the simulator, and the first control executiontime is measured at the simulator, a process of calculating an estimatedexecution time which is an estimated value of an execution time, at thecontroller, of a second control program which is an object programgenerated from the control source program and operating at thecontroller, by converting the first control execution time using thecalibration data, and a process for outputting data representing theestimated execution time.

Preferably, the storage unit is further used for storing the firstcontrol program. The controller support program further causes theoperation unit to execute a process of causing the controller supportapparatus to function as the simulator, and a process of measuring thefirst control execution time by executing the first control program atthe simulator.

More preferably, the storage unit is further used for storing the firsttest program and the second test execution time. The controller supportprogram further causes the operation unit to execute a process ofmeasuring the first test execution time by executing the first testprogram at the simulator, and a process of calculating the calibrationdata from the first test execution time and the second test executiontime.

According to yet another aspect of the present disclosure, a method ofestimating an execution time of a control program of a controllercontrolling an object to be controlled is provided. This method includesa calibration data calculation step of calculating calibration datarepresenting a relation between a first test execution time and a secondtest execution time. The first test execution time is an execution timeof a first test program which is an object program generated from a testsource program and operating at a simulator of the controller. The firsttest execution time is measured at the simulator. The second testexecution time is an execution time of a second test program which is anobject program generated from the test source program and operating atthe controller. The second test execution time is measured at thecontroller. The method further includes an estimated execution timecalculation step of using a first control execution time which is anexecution time of a first control program which is an object programgenerated from a control source program, which is a source program of acontrol program generated in accordance with an object of control of auser, and operating at the simulator. The first control execution timeis measured at the simulator. The method allows calculation of anestimated execution time which is an estimated value of an executiontime, at the controller, of a second control program which is an objectprogram generated from the control source program and operating at thecontroller, by converting the first control execution time using thecalibration data.

According to still another aspect of the disclosure, a non-transitorycomputer readable storage medium storing a controller support program isprovided that allows a computer apparatus to estimate control programexecution time. The program allowing the computer apparatus to acquire afirst control execution time that includes an execution time of a firstcontrol program which is an object program generated from a controlsource program, which is a source program of a control program generatedin accordance with an object of control of a user, and operating at asimulator, the first control execution time being measured at thesimulator. Additionally, the program allows the computer apparatus tocalculate an estimated execution time comprising an estimated value ofan execution time, at a controller, of a second control program which isan object program generated from the control source program andoperating at the controller, by converting the first control executiontime using calibration data representing a relationship between a firsttest execution time a second test execution time. Further, the programallows the computer apparatus to output data representing the estimatedexecution time. The first test execution time is an execution time of afirst test program which is an object program generated from a testsource program and operating at a simulator of the controller. The firsttest execution time is measured at the simulator. The second testexecution time is an execution time of a second test program which is anobject program generated from the test source program and operating atthe controller. The second test execution time is measured at thecontroller.

According to another aspect of the disclosure, the storage stores thefirst control program, and the controller support program further causesthe computer apparatus to cause the controller support apparatus tofunction as the simulator, and measure the first control execution timeby executing the first control program at the simulator.

According to another aspect of the disclosure, the storage stores thefirst test program and the second test execution time, and thecontroller support program further causes the computer apparatus tomeasure the first test execution time by executing the first testprogram at the simulator, and calculate the calibration data from thefirst test execution time and the second test execution time.

Effects of the Disclosure

With the present disclosure, it is possible to estimate, in a controllersupport apparatus, a control program execution time at a controller withhigher accuracy.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram illustrating a schematic configuration ofa PLC system, use of which is supported by a controller (PLC) supportapparatus according to an embodiment of the present disclosure.

FIG. 2 is a schematic diagram illustrating a hardware configuration of aCPU unit, use of which is supported by the controller (PLC) supportapparatus according to an embodiment of the present disclosure.

FIG. 3 is a schematic diagram illustrating a configuration of softwarethat is executed by the CPU unit, use of which is supported by thecontroller (PLC) support apparatus according to an embodiment of thepresent disclosure.

FIG. 4 is a sequence diagram showing an example execution operation inthe CPU unit, use of which is supported by the controller (PLC) supportapparatus according to an embodiment of the present disclosure.

FIG. 5 is a schematic diagram illustrating a hardware configuration ofthe controller support apparatus according to an embodiment of thepresent disclosure.

FIG. 6 is a schematic diagram illustrating a software configuration ofthe controller support apparatus according to an embodiment of thepresent disclosure.

FIG. 7 is a schematic diagram illustrating an overall process relatingto the controller support apparatus according to an embodiment of thepresent disclosure.

FIG. 8 is a diagram showing an example of a display screen of estimatedexecution time, the screen being output from the controller supportapparatus according to an embodiment of the present disclosure.

FIG. 9 is a diagram showing another example of the display screen ofestimated execution time, the screen being output from the controllersupport apparatus according to an embodiment of the present disclosure.

FIG. 10 is a diagram showing an example of the relation between a firsttest execution time and a second test execution time.

FIG. 11 is a schematic diagram illustrating an overall process relatingto a controller support apparatus realized by a server computeraccording to an embodiment of the present disclosure.

DETAILED DESCRIPTION

In the following, embodiments of the disclosure are explained in detailwith reference to the accompanying drawings. It should be noted that inthe drawings, identical or corresponding portions have been assigned thesame reference numerals, and their explanation is not repeated.

A. System Configuration

A PLC will be described as a typical example of a controller, use ofwhich is supported by a controller support apparatus according to thepresent embodiment. The PLC controls objects to be controlled such asmachinery or equipment. The PLC includes a CPU unit as its element. TheCPU unit includes a microprocessor, storage means (a storage), and acommunication circuit. The storage means is used for storing controlprograms and system programs for controlling program execution, forexample. The microprocessor executes system programs and controlprograms stored in the storage means. The communication circuit sendsoutput data and receives input data.

First, the system configuration of a PLC 1 will be described withreference to FIG. 1. FIG. 1 is a schematic diagram illustrating aschematic configuration of a PLC system, use of which is supported by acontroller (PLC) support apparatus according to an embodiment of thepresent disclosure.

Referring to FIG. 1, a PLC system SYS includes the PLC 1, servo motordrivers 3 and a remote IO terminal 5 that are connected to the PLC 1 viaa field network 2, and a detection switch 6 and a relay 7 as fielddevices. Also, a controller support apparatus 8 is connected to the PLC1 via a connection cable 10 or the like.

The PLC 1 includes a CPU unit 13 that executes main arithmeticprocessing, at least one IO unit 14, and a special unit 15. These unitsare configured such that they can mutually exchange data via a PLCsystem bus 11. Also, these units are supplied with power at anappropriate voltage by a power supply unit 12. Note that since each unitthat constitutes the PLC 1 is provided by PLC manufacturers, generally,each PLC manufacturer independently develops the PLC system bus 11 foruse. In contrast, with respect to the field network 2, its standard orthe like is disclosed in many cases such that products manufactured bydifferent manufacturers can be connected to each other.

The CPU unit 13 will be described in detail with reference to FIG. 2.The IO unit 14 is a unit relating to a general input and output process,and handles input and output of binarized data such as “on” and “off”.That is, the IO unit 14 collects information as to whether a sensor suchas the detection switch 6 is in a state where the sensor has detected anobject to be detected (“on” state) or in a state where the sensor hasdetected no object to be detected (“off” state). Also, the IO unit 14outputs either an instruction for activation (“on” instruction) or aninstruction for deactivation (“off” instruction) to an outputdestination such as the relay 7 or an actuator.

The special unit 15 has functions that are not supported by the IO unit14, for example, input and output of analog data, temperature control,or communication by a specific communication system.

The field network 2 transmits various types of data to be exchanged withthe CPU unit 13. Typically, various types of industrial Ethernet®systems can be used as the field network 2. For example, EtherCAT®,Profinet IRT, MECHATROLINK®-III, Powerlink, SERCOS®-III, and CIP Motionare known as industrial Ethernet® systems, and any of these may beemployed. In addition, a field network that is not an industrialEthernet® may be used. For example, if motion control is not performed,DeviceNet, CompoNet/IP® and the like may be used.

Note that although a PLC system SYS that includes both the PLC systembus 11 and the field network 2 is shown in FIG. 1 as an example, asystem configuration may be adopted in which only one of them isincluded. For example, all units may be connected to each other with thefield network 2. Alternatively, the servo motor drivers 3 may bedirectly connected to the PLC system bus 11 without using the fieldnetwork 2. Furthermore, a communication unit of the field network 2 maybe connected to the PLC system bus 11, such that communication withdevices connected to the field network 2 from the CPU unit 13 isperformed via that communication unit.

Note that the PLC 1 may have a configuration in which the CPU unit 13directly controls units to be controlled, not through the IO units 14 orthe servo motor drivers 3, by providing the CPU unit 13 with thefunction of the IO units 14 or the servo motors driver 3.

The servo motor drivers 3 are connected to the CPU unit 13 via the fieldnetwork 2, and drive the servo motors 4 in accordance with instructionvalues from the CPU unit 13. More specifically, the servo motor drivers3 receive, from the PLC 1, instruction values such as a positioninstruction value, a velocity instruction value and a torque instructionvalue at fixed intervals. Also, the servo motor drivers 3 acquire actualmeasured values relating to the operations of the servo motors 4 such asthe position, velocity (typically, this is calculated based on thedifference between the current position and the previous position) and atorque, from detectors such as a position sensor (rotary encoder) and atorque sensor that are connected to the shafts of the servo motors 4.Then, the servo motor drivers 3 perform feedback control by setting theinstruction values from the CPU unit 13 as the target values, and usingthe actual measured values as the feedback values. That is, the servomotor drivers 3 adjust the current for driving the servo motors 4 suchthat the actual measured values approach the target values. Note thatthe servo motor drivers 3 may also be referred to as a servo motoramplifier.

Although a system example in which the servo motors 4 and the servomotor drivers 3 are combined is shown in FIG. 1, other configurationsmay be also adopted, for example, a system in which a pulse motor and apulse motor driver are combined.

The remote IO terminal 5 is further connected to the field network 2 ofthe PLC system SYS shown in FIG. 1. Basically, the remote IO terminal 5performs processing relating to a general input and output process, aswith the IO unit 14. More specifically, the remote IO terminal 5includes a communication coupler 52 for performing processing relatingto data transmission through the field network 2, and one or more IOunits 53. These units are configured to be capable of exchanging datawith each other via a remote IO terminal bus 51.

The controller support apparatus 8 according to the present embodimentwill be described later.

B. Hardware Configuration of CPU

Next, with reference to FIG. 2, a hardware configuration of the CPU unit13 will be described. FIG. 2 is a schematic diagram illustrating thehardware configuration of the CPU unit 13, use of which is supported bythe controller (PLC) support apparatus 8 according to an embodiment ofthe present disclosure. Referring to FIG. 2, the CPU unit 13 includes amicroprocessor 100, a chip set 102, a main memory 104, a non-volatilememory 106, a system timer 108, a PLC system bus controller 120, a fieldnetwork controller 140, and a USB connector 110. The chip set 102 isconnected to other components via various types of buses.

Typically, the microprocessor 100 and the chip set 102 are configuredaccording to general computer architectures. That is, the microprocessor100 interprets and executes command codes that are supplied in orderfrom the chip set 102 according to an internal clock. The chip set 102exchanges internal data with various components connected thereto, andalso generates command codes necessary for the microprocessor 100. Inaddition, the chip set 102 has a function of caching, for example, dataacquired as a result of execution of arithmetic processing by themicroprocessor 100.

The CPU unit 13 includes the main memory 104 and the non-volatile memory106 as its storage means.

The main memory 104 is a volatile storage area (RAM), and holds variousprograms to be executed by the microprocessor 100 after the CPU unit 13is powered on. Also, the main memory 104 is used as a working memorywhen the microprocessor 100 executes various programs. A device such asa DRAM (Dynamic Random Access Memory) or a SRAM (Static Random AccessMemory) is used as the main memory 104.

The non-volatile memory 106 holds data such as a real-time OS (OperatingSystem), system programs of the PLC 1, user programs, motion operationprograms, system setting parameters in a non-volatile manner. Theseprograms and data are copied in the main memory 104 as required suchthat the microprocessor 100 can access them. Semiconductor memories suchas a flash memory can be used as the non-volatile memory 106.Alternatively, a magnetic storage medium such as hard disk drive, anoptical storage medium such as DVD-RAM (Digital Versatile Disk RandomAccess Memory), and the like may be used.

The system timer 108 generates an interrupt signal at fixed intervalsand thereby provides the interrupt signal to the microprocessor 100.Typically, the system timer 108 is configured such that it generatesinterrupt signals at a plurality of different intervals depending onhardware specifications. However, it is also possible to perform settingwith the OS (Operating System), the BIOS (Basic Input Output System), orthe like such that interrupt signals are generated at arbitraryintervals. Control operation for each control cycle, which is to bedescribed later, is realized by using an interrupt signal generated bythe system timer 108.

The CPU unit 13 includes the PLC system bus controller 120 and the fieldnetwork controller 140 as the communication circuit. These communicationcircuits send output data and receive input data.

Note that if the CPU unit 13 is provided with a function of the IO units14 or the servo motor drivers 3, sending of output data and receiving ofinput data by the communication circuit will be performed inside the CPUunit 13, while having the unit performing the corresponding function asthe other party of communication.

The PLC system bus controller 120 controls exchange of data via the PLCsystem bus 11. More specifically, the PLC system bus controller 120includes a DMA (Dynamic Memory Access) control circuit 122, a PLC systembus control circuit 124, and a buffer memory 126. Note that the PLCsystem bus controller 120 is internally connected to the PLC system bus11 via a PLC system bus connector 130.

The buffer memory 126 functions as a send buffer of data to be output toother units via the PLC system bus 11 (hereinafter also referred to as“output data”) and a receive buffer of data to be input from other unitsvia the PLC system bus 11 (hereinafter also referred to as “inputdata”). Note that output data generated as a result of arithmeticprocessing by the microprocessor 100 is initially stored in the mainmemory 104. Then, output data to be transferred to a specific unit isread out from the main memory 104, and temporarily held in the buffermemory 126. Also, input data transferred from other units is temporarilyheld in the buffer memory 126, and then transferred to the main memory104.

The DMA control circuit 122 transfers output data from the main memory104 to the buffer memory 126, and transfers input data from the buffermemory 126 to the main memory 104.

The PLC system bus control circuit 124 performs a process of sendingoutput data in the buffer memory 126 to other units connected to the PLCsystem bus 11 and a process of receiving input data and storing theinput data in the buffer memory 126 from the other units. Typically, thePLC system bus control circuit 124 provides the functions of a physicallayer and a data link layer in the PLC system bus 11.

The field network controller 140 controls data exchange via the fieldnetwork 2. That is, the field network controller 140 controls sending ofoutput data and receiving of input data according to the used standardof the field network 2. For example, when a field network 2 conformingto the EtherCAT® standard is used, a field network controller 140 thatincludes hardware for performing normal Ethernet® communication is used.With the EtherCAT® standard, a general Ethernet® controller thatrealizes a communication protocol conforming to an ordinary Ethernet®standard can be used. Depending on the type of the industrial Ethernet®employed as the field network 2, an Ethernet® controller supporting thecommunication protocol of dedicated specifications that is not anordinary communication protocol is used. Also, if a field network otherthan the industrial Ethernet® is employed, a dedicated field networkcontroller conforming to the corresponding standard is used.

A buffer memory 146 functions as a send buffer of data to be output toother apparatuses or the like via the field network 2 (hereinafter, thisdata is also referred to as “output data”) and a receive buffer of datato be input from other apparatuses or the like via the field network 2(hereinafter, this data is also referred to as “input data”). Asdescribed above, output data generated as a result of arithmeticprocessing performed by the microprocessor 100 is initially stored inthe main memory 104. Then, output data to be transferred to a specificapparatus is read out from the main memory 104, and temporarily held inthe buffer memory 146. Also, input data transferred from otherapparatuses is temporarily held in the buffer memory 146, and thentransferred to the main memory 104.

A DMA control circuit 142 transfers output data from the main memory 104to the buffer memory 146, and transfers input data from the buffermemory 146 to the main memory 104.

A field network control circuit 144 performs a process of sending outputdata in the buffer memory 146 to other apparatuses connected to thefield network 2 and a process of receiving input data from the otherapparatuses and storing the input data in the buffer memory 146.Typically, the field network control circuit 144 provides the functionsof a physical layer and a data link layer in the field network 2.

The USB connector 110 is an interface for connecting the controllersupport apparatus 8 and the CPU unit 13. Typically, programs and thelike executable by the microprocessor 100 of the CPU unit 13, which aretransferred from the controller support apparatus 8, are loaded to thePLC 1 via the USB connector 110.

C. Software Configuration of CPU

Next, a software group used for a controller (PLC 1) to provide varioustypes of functions will be described with reference to FIG. 3. Commandcode included in the software is read out at an appropriate time, andexecuted by the microprocessor 100 of the CPU unit 13.

FIG. 3 is a schematic diagram illustrating a configuration of softwareexecuted by the CPU unit 13, used of the software being supported by thecontroller (PLC) support apparatus 8 according to an embodiment of thepresent disclosure. Referring to FIG. 3, software to be executed by theCPU unit 13 has a three-layer structure including a real-time OS 200, asystem program 210, and a user program 236.

The real-time OS 200 is designed according to the computer architectureof the CPU unit 13, and provides a fundamental execution environment forthe microprocessor 100 to execute the system program 210 and the userprogram 236. This real-time OS is typically provided by PLCmanufacturers or specialized software companies.

The system program 210 is a software group for providing functions asthe PLC 1. Specifically, the system program 210 includes a schedulerprogram 212, an output process program 214, an input process program216, a sequence command operation program 232, a motion operationprogram 234, and other system programs 220. Note that generally, theoutput process program 214 and the input process program 216 areexecuted in series (as a single process), these programs may besometimes referred to as an IO process program 218.

The user program 236 is generated in accordance with an object ofcontrol of a user. That is, it is a program arbitrarily designedaccording to a line (process) or the like to be controlled by using thePLC system SYS.

The user program 236 realizes the object of control of the usercooperatively with the sequence command operation program 232 and themotion operation program 234. That is, the user program 236 realizesprogrammed operations by using commands, functions, function modules, orthe like provided by the sequence command operation program 232 and themotion operation program 234. Therefore, the user program 236, thesequence command operation program 232 and the motion operation program234 may be collectively referred to as a control program 230.

Each program will be described in detail below.

The user program 236 is generated according to an object of control ofthe user (e.g., line or process to be controlled) as described above.Typically, the user program 236 is in an object program executable bythe microprocessor 100 of the CPU unit 13. This user program 236 isgenerated as a result of a source program described in the ladderlanguage or the like being compiled in the controller support apparatus8, for example. The generated user program 236 as an object program istransferred from the controller support apparatus 8 to the CPU unit 13via the connection cable 10, and is stored in the non-volatile memory106 or the like.

The scheduler program 212 controls start of process and restart ofinterrupted process in each execution cycle with respect to the outputprocess program 214, the input process program 216, and the controlprogram 230. More specifically, the scheduler program 212 controlsexecution of the user program 236 and the motion operation program 234.

In the CPU unit 13, an execution cycle (control cycle) having a fixedinterval that is suitable for the motion operation program 234 isemployed as a common cycle for the entire process. Therefore, it isdifficult to complete all processes during a single control cycle, andthus a process whose execution should be completed during a singlecontrol cycle and a process that may be executed across a plurality ofcontrol cycles are distinguished depending on the priority of theprocess to be executed. The scheduler program 212 manages the executionorder or the like of these distinguished processes. More specifically,the scheduler program 212 performs management such that programs givenhigher priorities are executed earlier during the period of each controlcycle.

The output process program 214 rearranges output data generated as aresult of execution of the user program 236 (control program 230) into aformat suitable for transfer to the PLC system bus controller 120 and/orthe field network controller 140. If the PLC system bus controller 120or the field network controller 140 requires an instruction to performsending from the microprocessor 100, the output process program 214 willissue the instruction.

The input process program 216 rearranges input data received by the PLCsystem bus controller 120 and/or the field network controller 140 into aformat suitable for use by the control program 230.

The sequence command operation program 232 is called when a certain typeof sequence command used in the user program 236 is executed, andexecuted for realizing the command.

The motion operation program 234 is executed according to instructionsprovided by the user program 236, and calculates instruction valuesoutput to a motor driver such as the servo motor drivers 3 or a pulsemotor driver at every execution.

The other system programs 220 collectively show a program group forrealizing various types of functions of the PLC 1 other than theprograms specifically shown in FIG. 3.

The real-time OS 200 provides an environment for switching and executinga plurality of programs with the lapse of time. In the PLC 1, as anevent (interrupt) for outputting (sending) output data generated as aresult of program execution by the CPU unit 13 to other units or otherapparatuses, a control cycle start interrupt is set as default. When thecontrol cycle start interrupt has occurred, the real-time OS 200switches the program to be executed by the microprocessor 100 from aprogram being executed at that time to the scheduler program 212. Notethat the real-time OS 200 executes a program included in the othersystem programs 210 when neither the scheduler program 212 nor a programwhose execution is controlled by the scheduler program 212 is beingexecuted. Examples of such a program include programs relating to thecommunication process between the CPU unit 13 and the controller supportapparatus 8 via the connection cable 10 (USB) or the like.

Note that the control program 230 and the scheduler program 212 arestored in the main memory 104 and the non-volatile memory 106 serving asstorage means.

D. Execution Operation in CPU

Next, execution operation performed by the CPU unit 13 will bedescribed.

FIG. 4 is a sequence diagram showing an example of execution operationperformed by the CPU unit 13, use of which is supported by thecontroller (PLC) support apparatus 8 according to an embodiment of thepresent disclosure. In FIG. 4, along the time axis along which timeelapses from the top to the bottom of the paper face, periods duringwhich an IO process program, a control program A and a control program Bare executed are shown.

Round-cornered rectangles indicated by the broken line along the timeaxes of the control programs A and B each indicate the execution cycleof the corresponding control program. In the example shown in FIG. 4,the control program A employs a single control cycle as its executioncycle, whereas the control program B employs four control cycles as itsexecution cycle. Also, it is assumed that the execution priority of thecontrol program A is set higher than that of the control program B.

The sequence program (user program) of the control program A includes amotion command for realizing motion control, and the motion operationprogram 234 is called and executed as a result of execution of themotion command. In contrast, the sequence program of the control programB does not include a motion command.

When a control cycle 1 is started, the IO process program is executeddue to execution control performed by the scheduler program 212.

When the output process and the input process due to execution of the IOprocess program have finished, the control program A is executed due toexecution control performed by the scheduler program 212. When executingthe control program A, the sequence program is first executed, and thenthe motion operation program 234 is executed. The sequence commandoperation program 232 is executed every time it is called duringexecution of the sequence program. The entire control program A (thesequence program and the motion operation program) is configured as asingle thread, and is executed continuously without involvement of thescheduler program 212 during execution.

When the execution of the control program A is ended, the controlprogram B is executed due to execution control performed by thescheduler program 212. However, since the control cycle 1 ends (acontrol cycle 2 starts) while the control program B is being executed,execution of the control program B is interrupted at that time.

Also in the control cycle 2 onward, execution of the IO process programand the control program A is repeated in the same manner as in thecontrol cycle 1. When execution of the control program A in the controlcycle 2 ends, the unexecuted portion of the control program B isexecuted. However, the control cycle 2 also ends while the controlprogram B is being executed, and thus execution of the control program Bis again interrupted.

Execution of the control program B whose execution has been recommencedin a control cycle 3 ends before the end of the control cycle 3.

Although the execution cycle of the control program B that has startedin the control cycle 1 has not yet ended in a control cycle 4, sinceexecution of the control program B in that execution cycle has alreadyended in the control cycle 3, the control program B is not executed inthe control cycle 4.

E. Hardware Configuration of Support Apparatus

Next, the controller support apparatus 8 for performing, for example,generation of programs executed by the PLC 1 and maintenance of the PLC1 will be described.

FIG. 5 is the schematic diagram illustrating a hardware configuration ofthe controller support apparatus 8 according to an embodiment of thepresent disclosure. Referring to FIG. 5, the controller supportapparatus 8 is typically configured by a general-purpose computer. Notethat from the standpoint of maintenance, the controller supportapparatus 8 is preferably configured by a laptop personal computer,which has good portability.

Referring to FIG. 5, the controller support apparatus 8 includes a CPU81 that executes various types of programs including an OS, a ROM (ReadOnly Memory) 82 that stores an BIOS and various types of data, forexample, and a memory RAM 83 that provides a working region for storingdata that is necessary for execution of programs by the CPU 81, and ahard disk (HDD) 84 that stores, for example, programs executed by theCPU 81 in a non-volatile manner. The CPU 81 corresponds to the operationunit of the controller support apparatus 8, and the ROM 82, the RAM 83and the hard disk 84 correspond to the storage unit of the controllersupport apparatus 8.

The controller support apparatus 8 further includes a keyboard 85 and amouse 86 that receive operation from a user, and a monitor 87 forpresenting information to the user. In addition, the controller supportapparatus 8 includes a communication interface (IF) 89 for communicatingwith the PLC 1 (CPU unit 13) and the like.

As described later, various types of programs executed by the controllersupport apparatus 8 are stored in a CD-ROM 9 and distributed. Theprograms stored in the CD-ROM 9 are read by a CD-ROM (Compact Disk-ReadOnly Memory) drive 88 to be stored in the hard disk (HDD) 84, forexample. Alternatively, a configuration may be adopted in which programsare downloaded through a network from a superordinate apparatus such asa host computer.

As described above, since the controller support apparatus 8 is realizedby using a general-purpose computer, a further description of thecontroller support apparatus 8 will not be given.

F. Software Configuration of Controller Support Apparatus

Next, referring to FIG. 6, a software group used for the controllersupport apparatus 8 according to the present embodiment to providevarious types of functions will be described.

FIG. 6 is a schematic diagram illustrating the software configuration ofthe controller support apparatus 8 according to an embodiment of thepresent disclosure. Referring to FIG. 6, an OS 310 is executed in thecontroller support apparatus 8, and an environment is provided in whichexecution of various types of programs included in a controller supportprogram 320 is possible.

The controller support program 320 includes an editor program 321, acompiler program 322, a debugger program 323, a simulator program 324, acalibration data calculation program 325, an estimated execution timecalculation program 326, an output program 327, and a communicationprogram 328. Each program included in the controller support program 320is, typically, distributed in a state stored in the CD-ROM 9, andinstalled on the controller support apparatus 8.

The editor program 321 provides functions for generating a user program(source program) 330 such as an input function and an edit function.More specifically, the editor program 321 provides, in addition to afunction of generating the source program 330 of the user program 236 bythe user operating the keyboard 85, the mouse 86 or the like, a functionof saving and a function of editing the generated source program 330.Also, the editor program 321 externally receives a source program of thecontrol program 230 (in particular, the user program 236), or edits asource program of the existent control program 230 according to user'soperations.

The compiler program 322 provides a function of generating the userprogram (second control program) 236 in an object program format that isexecutable by the microprocessor 100 of the CPU unit 13 by compiling thesource program 330 of the control program. Also, the compiler program322 provides a function of generating a user program (first controlprogram) 340 in an object program format that is executable by the CPU81 of the controller support apparatus 8 by compiling the source program330 of the control program. This user program 340 is an object programfor simulation, which is used for the controller support apparatus 8 tosimulate operations of the PLC 1.

The debugger program 323 provides a function of debugging the userprogram (source program) 330. This debugging includes operations such aspartially executing the source program by executing a region of thesource program designated by the user, and tracking temporal changes invariable values during execution of the source program, for example.

When the simulator program 324 is executed, it builds a simulator of theCPU unit 13 (controller) of the PLC 1 in the controller supportapparatus 8. The simulator provides functions described below.

(1) A function of a real-time OS of the CPU unit 13 that starts thecontrol cycle upon a signal from a system timer.

(2) A function of the scheduler program 212 of the CPU unit 13 thatcontrols execution of the control program 230 according to the executionpriority and the execution cycle of the control program.

(3) A function of the output process program 214 and the input processprogram 216 of the CPU unit 13.

(4) A function of providing input data in place of an object to becontrolled, and if possible, a function of simulating the object to becontrolled that operates as a result of receiving output data andreflecting the operation result to the input data.

Also, the simulator program 324 provides a program corresponding to thesequence command operation program 232 and/or the motion operationprogram 234 in the CPU unit 13, which is necessary for the first controlprogram (simulator object program) 340 to operate on a simulator.

Since the execution code of the first control program (simulator objectprogram) 340 can be executed by the CPU 81 of the controller supportapparatus 8, the execution code is directly executed by the CPU 81 ofthe controller support apparatus 8 under execution control or support inthe above-described execution environment.

Alternatively, the simulator program 324 may vertically build themicroprocessor 100 of the CPU unit 13 so as to operate the secondcontrol program (controller object program) 236 on the simulator. Inthis case, the first control program (simulator object program) 340 andthe second control program (controller object program) 236 are the sameprogram, and thus these programs need not be generated separately.

Also if the CPU 81 of the controller support apparatus 8 and themicroprocessor 100 of the CPU unit 13 are the processors of the samesystem, and the CPU 81 can execute the execution code of the secondcontrol program (controller object program) 236, the first controlprogram (simulator object program) 340 and the second control program(controller object program) 236 will be the same program.

The calibration data calculation program 325 configures, as a result ofbeing executed, a calibration data calculation unit 325A that is shownin FIG. 7 and is described below. The estimated execution timecalculation program 326 configures, as a result of being executed, anestimated execution time calculation unit 326A that is shown in FIG. 7and is described below. The output program 327 configures, as a resultof being executed, an output unit 327A that is shown in FIG. 7 and isdescribed below. Processes provided by these programs will be describedlater with reference to FIG. 7.

The communication program 328 provides a function of transferring theobject program 236 for the CPU unit 13 of the control program 230 to theCPU unit 13 of the PLC 1.

Generally, the system program 210 mounted on the PLC 1 is stored in thenon-volatile memory 106 of the CPU unit 13 at the stage of manufacturingthe CPU unit 13. However, by storing the system program 210 in theCD-ROM 9, it is also possible for the user to copy the system program210 in the CD-ROM 9 to the controller support apparatus 8, and totransfer the copied system program 210 to the CPU unit 13 by usingfunctions provided by the communication program 328. Furthermore, bystoring the real-time OS 200 to be executed by the CPU unit 13 of thePLC 1 in the CD-ROM 9, the real-time OS 200 can also be reinstalled onthe PLC 1 by user's operations.

G. Overall Process Relating to Controller Support Apparatus

g1: General Description

Next, referring to FIG. 7, a series of processes relating to controlprogram execution time estimation as well as programs and the data flowbetween the processes will be described in addition to the processesperformed by the controller support apparatus 8.

FIG. 7 is a schematic diagram illustrating an overall process relatingto the controller support apparatus 8 according to an embodiment of thepresent disclosure. The controller support apparatus 8 whose softwareconfiguration is illustrated in FIG. 6 corresponds to a controllersupport apparatus A shown in FIG. 7.

The method of estimating the execution time of a control program shownin FIG. 7 is mainly configured by a step of calibration data calculationprocess and a step of estimated execution time calculation process.

The calibration data calculation process is a process of calculatingcalibration data that represents the relation between the execution timeat the controller and the execution time at the simulator that aremeasured in advance for a test program for calibration.

In the estimated execution time calculation process, an execution timeof a control program measured with a simulator is acquired, and theexecution time is converted using the calibration data, therebycalculating an estimated value of the execution time obtained when thecontrol program is executed by the controller.

Each process is described below in detail.

g2: Calibration Data Calculation Process

First, a source program (test source program) 370 of the test program isprepared.

A simulator object program (first test program) 390 is generated fromthe test source program 370 by using a simulator compiler 380. Also, acontroller object program (second test program) 392 is generated fromthe test source program 370 by using a controller compiler 382.

The execution time of the second test program 392 is measured byexecuting the second test program 392 by a controller A, and the data ofa second test execution time, which is the execution time of the secondtest program 392, is acquired.

Processes described so far are generally performed by a supplier of thecontroller (manufacturer, distributor, or technical service provider ofthe controller, for example), and the first test program 390 and thesecond test execution time are provided to the user. Note that theprocesses described so far may be performed by the user.

The first test program 390 is executed by a simulator 324A, theexecution time thereof is measured, and the data of a first testexecution time, which is the execution time of the first test program390, is acquired. Then, calibration data that represents the relationbetween the first test execution time and the second test execution timeis calculated.

As described above, the calibration data calculation process is aprocess of calculating calibration data that represents the relationbetween the first test execution time and the second test executiontime. Here, the first test execution time is an execution time measuredat the simulator of the first test program 390, which is an objectprogram that is generated from the test source program 370 and thatoperates at a simulator of a controller. Also, the second test executiontime is an execution time measured at the controller of the second testprogram 392, which is an object program that is generated from the testsource program 370 and that operates at the controller.

g3: Estimated Execution Time Calculation Process

Next, the control source program 330, which is a source program of thecontrol program generated in accordance with an object of control of theuser, is prepared.

The simulator object program (first control program) 340 is generatedfrom the control source program 330 by using a simulator compiler 322A.

The first control program 340 is executed at the simulator 324A, theexecution time thereof is measured, and data of a first controlexecution time, which is the execution time of the first controlprogram, is acquired.

By converting the first control execution time using the calibrationdata, an estimated execution time, which is an estimation value of theexecution time of a second control program 342 at a controller, thesecond control program 342 being an object program that is generatedfrom the control source program 330 and that operates at the controller,is calculated.

The second control program 342 is generated from the control sourceprogram 330 by using a controller compiler 322B. Actually, the secondcontrol program 342 may be generated after the control source program330 is modified as required based on the estimated execution time. Thegenerated second control program 342 is transferred to a controller B,and is executed by the controller B. Note that the controller A and thecontroller B can be regarded as the same model in terms of the executiontime.

As described above, the estimated execution time calculation process isa process of calculating the estimated execution time, which is anestimation value of the execution time of the second control program 342at the controller, the second control program 342 being an objectprogram that is generated from the control source program 330 and thatoperates at the controller, by converting, using the calibration data,the first control execution time, which is the execution time of thefirst control program 340 measured at the simulator 324A, the firstcontrol program 340 being an object program that is generated from thecontrol source program 330 serving as the source program of the controlprogram, which is generated in accordance with an object of control ofthe user, and that operates at the simulator 324A.

If the estimated execution time is calculated, a process of generatingoutput data that represents the estimated execution time and outputtingthe output data is executed. The process of generating and outputtingthe output data is, for example, a process of generating display datafor displaying the estimated execution time on the screen of the monitor87, and displaying the display data. The process of generating andoutputting output data may be a process of generating and sending datafor sending the estimated execution time to other apparatuses. Theprocess of outputting output data may be a process of storing the outputdata in a storage unit that is accessible from the outside of thecontroller support apparatus 8.

g4: Variation

If the simulator (controller support apparatus 8) and the controller(PLC 1) can execute the same object code, it is not necessary to usedifferent compilers as the simulator compiler and the controllercompiler, and a common compiler can be used. In this case, the firsttest program 390 and the second test program 392 will be the sameprogram, and the first control program 340 and the second controlprogram 342 will be the same program.

As the simulator compiler 380 used for compiling the test source program370 and the simulator compiler 322A used for compiling the controlsource program 330, compilers are used that are capable of generatingthe same object program if the same source program is compiled. Thisapplies to the controller compilers as well.

g5: Other Embodiments

It is convenient that the controller support apparatus 8 is configured,as illustrated as the controller support apparatus A in FIG. 7, suchthat all the processes performed after provision of the first testprogram 390 and the second test execution time can be executed by asingle apparatus.

However, from the standpoint of execution time estimation, generation ofthe object program may be performed by a different apparatus, and theprocesses performed by the controller support apparatus 8 may be limitedto those indicated with the controller support apparatus B in FIG. 7.

Alternatively, the simulator may be configured by a different apparatus,and the controller support apparatus 8 may acquire the first controlexecution time from the simulator as the different apparatus.

Alternatively, the calibration data calculation process may be performedby a different apparatus, and the controller support apparatus 8 mayacquire and store the calculated calibration data for use. Then, fromthe stand point of execution time estimation, the processes performed bythe controller support apparatus 8 may be limited to those indicated inFIG. 7 with a controller support apparatus C.

It is preferable to realize the controller support apparatuses A, B andC using portable or desktop personal computers.

Note that in any case, once the calibration data has been calculated,the stored first test program 390 and second test execution time may bedeleted.

The controller support apparatus C shown in FIG. 7 can be expressed asdescribed below. That is, the controller support apparatus C includes astorage unit (the ROM 82, the RAM 83 and the hard disk 84 in FIG. 5) andan operation unit (the CPU 81 in FIG. 5). The storage unit is used forstoring the controller support program 320 and calibration data thatrepresents the relation between the first test execution time and thesecond test execution time. The first test execution time is anexecution time measured at the simulator of the first test program 390,which is an object program that is generated from the test sourceprogram 370 and that operates at the controller. The second testexecution time is an execution time measured at the controller of thesecond test program 392, which is an object program that is generatedfrom the test source program 370 and that operates at the controller.

The controller support program 320 causes the operation unit (CPU 81) toexecute the processes described below.

(1) A process of acquiring the first control execution time, which is anexecution time measured at a simulator of the first control program 340,which is an object program that is generated from the control sourceprogram 330 serving as the source program of the control programgenerated in accordance with an object of control of the user, and thatoperates at a simulator.

(2) A process of calculating the estimated execution time, which is anestimation value of the execution time at the controller of the secondcontrol program 342, which is an object program that is generated fromthe control source program 330 and that operates at the controller, byconverting the first control execution time using the calibration data.

(3) A process for outputting data representing the estimated executiontime.

Also, the controller support apparatus B is assumed to display theestimated execution time in a display unit (the screen of the monitor 87shown in FIG. 5). The controller support apparatus B is an apparatusconfigured by adding the following configurations to the controllersupport apparatus C. That is, the controller support apparatus B furtherincludes a display unit. The storage unit is used for further storingthe first control program 340, the first test program 390 and the secondtest execution time. The controller support program 320 further causesthe operation unit (CPU 81) to execute the following processes.

(4) A process of causing the controller support apparatus to function asthe simulator.

(5) A process of measuring the first test execution time by executingthe first test program 390 by the simulator.

(6) A process of calculating the calibration data from the first testexecution time and the second test execution time

(7) A process of measuring the first control execution time by executingthe first control program 340 by the simulator.

The process for outputting data representing the estimated executiontime described above is a process of generating display data fordisplaying the estimated execution time by the display unit.

H. Display Example of Estimated Execution Time

Next, an output example (display example) of the estimated executiontime calculated by the processes described above will be described.

FIG. 8 is a diagram showing an example of the display screen ofestimated execution time output from the controller support apparatus 8according to an embodiment of the present disclosure.

In the example of the display screen of estimated execution time shownin FIG. 8, the control programs A and B shown in FIG. 4 are subjected toexecution time estimation. In the display screen, the control program Aand the control program B are respectively indicated as “TASK A” and“TASK B”.

The time displayed as the net execution time is the estimated executiontime. The net execution time refers to a time period that excludes anexecution pausing time, and during which the control program is actuallybeing executed. For example, in FIG. 4, the control program B isexecuted in three divided executions with two execution pausing periodsinterposed therebetween. The total of the time periods of the threedivided executions, during which the control program B is actually beingexecuted, serves as the net execution time.

In the display unit of the net execution time, the execution time of theIO process is also displayed. The IO process is indicated as “I/O”. Notethat the process of obtaining the execution time of the IO process isnot shown in FIG. 7. The execution time of the IO process has acorrelation with the number of other units connected to the CPU unit 13and the amount of output data and input data, and the larger the numberof other units or the amount of data, the longer the execution time ofthe IO process. The controller support apparatus 8 holds suchinformation in order to set the information in the controller, and thuscan calculate the estimation value of the execution time of the IOprocess using the information.

“500 μs” in the display unit of the net execution time indicates thatthe interval of the control cycle is 500 μs.

In the simulator, the first control execution time that serves as thebasis of estimated execution time (net execution time) calculation canbe measured by executing the control programs A and B separately withoutexecution pausing period. Also, as with actual execution by thecontroller, in the case of execution by the simulator as well, programsmay be executed in accordance with the execution priority and theexecution cycle according to the sequence shown in FIG. 4 so as tomeasure time actually required for the execution.

Measurement of the first control execution time and calculation of theestimated execution time may be repeated a plurality of times. When acontrol program is repeatedly executed, execution conditions such asvalues of variables used in the control program change, and accordingly,the execution time varies. The MAX value displayed with the graph of thenet execution time indicates a maximum value obtained when the controlprogram is repeatedly executed. In addition, a minimum value or anaverage value may be displayed.

The estimated execution time of the control program A is calculatedseparately for the sequence operation portion and the motion operationportion, which are separately indicated in the graph display as well.

The total execution time means a period of time from the start of anexecution cycle of each control program to the end of execution of thecontrol program in that execution cycle. That is, the total executiontime of the control program A corresponds to a period of time from thebeginning of each control cycle in FIG. 4 to the end of execution of thecontrol program A in that control cycle. The execution time of the IOprocess is included in this period of time in addition to the executiontime of the control program A.

Similarly, the total execution time of the control program B correspondsto a period of time from the beginning of the control cycle 1 in FIG. 4to the end of execution of the control program B in the control cycle 3.In this period of time is obtained by adding the execution time forthree times of the IO process and the execution time for three dividedexecutions of the control program A, which are executed by the end ofexecution of the control program B.

“0.5 ms” and “2 ms” in the display unit of the total execution time eachindicate the interval of the execution cycle of the correspondingcontrol program. Also, as with the case of the net execution time, amaximum value of the total execution time of each control program isdisplayed. Displaying the total execution time enables a user to knowwhether execution of each control program can be completed within thecorresponding execution cycle time.

FIG. 9 is a diagram showing another example of the display screen of theestimated execution time output from the controller support apparatus 8according to an embodiment of the present disclosure.

The display screen shown in FIG. 9 differs from that shown in FIG. 8 inthat the execution time of the IO process is included in the TASK A inthe display unit of the net execution time.

That is, in the display screen shown in FIG. 9, the execution time ofthe IO process that is executed at the same interval as that of theexecution cycle of a control program (in this case, the control programA) is added to the execution time of that control program in thedisplay. In this manner, display of the estimated execution time of acontrol program includes the display in which the execution time of thecontrol program and the execution time of other processes executed incombination with the control program are added. In other words, it isnot always necessary to display the estimated execution time of thecontrol program itself, and it is sufficient to display a time thatincludes the estimated execution time of the control program so as tohelp a user in deciding the control cycle interval or the executioncycle interval, or how to divide the control program, for example.

The graph of the TASK A for the net execution time is displayed suchthat the execution time of the IO process and the execution time of thecontrol program A can be distinguished. “MAX value” displayed with thegraph indicates the execution time including the IO process time, andthus the estimated execution time of the control program is notdisplayed as a numerical value. In this manner, the estimated executiontime of the control program may be displayed by a graph only.

Furthermore, only one of the net execution time and the total executiontime may be displayed. Displaying the total execution time also servesas an embodiment of display of the estimated execution time of thecontrol program.

I. Process of Calculating Calibration Data

Next, a process of calculating calibration data representing therelation between the first test execution time and the second testexecution time will be described.

FIG. 10 is a diagram showing an example of the relation between thefirst test execution time and the second test execution time. In FIG.10, the X axis (horizontal axis) indicates the first test time (measuredvalue of the execution time of the first test program 390 at thesimulator), and the Y axis (vertical axis) indicates the second testexecution time (measured value of the execution time of the second testprogram 392 at the controller).

As described above, the first test program 390 and the second testprogram 392 are object programs generated from the same test sourceprogram 370. Measurement points P1 to P5 shown in the graph of FIG. 10indicate execution times of the first and test programs generated fromfive types of test source programs 370 that include mutually differentnumbers of commands to be executed.

Note that the measurement points P1 to P5 may take measured values ofexecution time obtained when each program is executed one time. However,taking into account the fact that the execution time may vary at eachexecution depending on execution conditions such as input variablevalues, it is preferable to employ an average value of execution timesobtained by executing a single program a plurality of times.

When a general-purpose computer is used as the controller supportapparatus 8, the first test program 390 is generally executed under anon-real-time operating system environment, and thus execution of thefirst test program may be interrupted by the operating system. Since themeasured value of the execution time in such a case will be anabnormally large value, it is necessary to eliminate such an abnormalvalue from calculation when obtaining the average value of the executiontime. Similarly, the first control execution time, which is the basis ofcalculation of the estimated execution time, may also take an abnormalvalue. Thus, it is necessary to eliminate such an abnormal value fromcalculation of the estimated execution time.

A straight line L is obtained by using a least-square method so as toachieve the smallest error with respect to the measurement points P1 toP5. In this example, the straight line L is expressed by the equationY=aX. The proportionality coefficient “a” serves as calibration data.

The estimated execution time can be calculated by multiplying the firstcontrol execution time that is the control program execution timemeasured at the simulator by the calibration data “a”.

The straight line L can also be expressed by the equation Y=aX+b, and inthis case, the values of “a” and “b” serve as calibration data.

Since the first test execution time and the second test execution timesubstantially have a proportional relation, it is possible to expressthe relation therebetween by a straight line, but in some cases, it isbetter to use multidimensional functions such as a quadric curve or acubic curve in order to express the relation more precisely. In suchcases, coefficients defining the multidimensional functions serve ascalibration data.

A possible cause for the case where the relation between the first testexecution time and the second test execution time cannot be expressed bythe straight line is influence of operations performed by a cashmechanism of the CPU 81 of the controller support apparatus 8 or amicroprocessor of the controller (the microprocessor 100 of the PLC 1).It is conceivable that due to the cash mechanism operations, themeasured value of a short execution time may not take a value on thestraight line obtained based on the measured values of execution timeseach having a certain amount of time.

The calibration data may be table-form data that shows a plurality offirst test times and second test times corresponding to the first testtimes. When such calibration data is used, it is possible to obtain theestimated execution time corresponding to a first control execution timeby selecting two first test times whose values having the value of thefirst control execution time therebetween, or several first test timeshaving values close to the value of the first control execution time,and by interpolating a line or a curve based on data in the calibrationdata.

J. Server-Client Form

Although a case in which a process of estimating control programexecution time is realized by a stand-alone form was described above asan example, the process may be realized by a so-called server-clientform.

FIG. 11 is a schematic diagram illustrating an overall process relatingto a controller support apparatus realized by a server computeraccording to an embodiment of the present disclosure. FIG. 11 shows aseries of processes relating to control program execution timeestimation, as well as programs and the data flow between the processeswhen the controller support apparatus is realized by a server computer.

Referring to FIG. 11, the server computer that functions as thecontroller support apparatus includes a program group that functions asa simulator compiler 322A, a controller compiler 322B, a simulator 324A,an estimated execution time calculation unit 326A, and an output unit327A.

For example, the server computer may be installed in the user's businessplace and connected to a client computer through LAN, or may beinstalled in the business place of the controller provider and connectedto a client computer in the user's business place through the Internet.

Also, calibration data stored in the storage unit in FIG. 11 iscalculated through the same processes shown in FIG. 7. A process ofcalculating the calibration data may be performed using a differentcomputer, or the server computer may perform the whole or part of theprocess of calculating the calibration data. Note that when a simulatorfor executing the first test program is provided in a differentcomputer, the simulator is required to be capable of executing the sameprogram in the same execution time as the simulator in the servercomputer.

Even in the case where the server computer performs a series ofprocesses up to obtaining the calibration data, in the stage where theserver computer provides a service to a client computer, it issufficient that the calibration data can be used. For this reason,programs and data used for obtaining the calibration data may be deletedfrom the server computer.

The control source program 330 is generated in the client computer andsent to the server computer.

The server computer generates, with the controller compiler 322B, asecond control program 342 from the control source program 330 accordingto an instruction from the client computer, and sends the second controlprogram 342 to the client computer. The server computer may not includethe controller compiler 322B, and may not provide the service ofgenerating the second control program 342.

The simulator compiler 322A generates a first control program (simulatorobject program) 340 from the control source program 330.

The simulator 324A executes the first control program 340 and measuresthe execution time thereof, namely, the first control execution time.

The estimated execution time calculation unit 326A uses the calibrationdata to calculate the estimated execution time from the first controlexecution time.

The output unit 327A generates, for example, display data for displayingthe estimated execution time in the form shown in FIG. 8 or FIG. 9, andsends the display data to the client computer. The display data is, forexample, HTML format data that can be displayed with a web browser. Theoutput unit 327A may send only numerical value data indicating estimatedexecution time to the client computer, and allow the client computer todecide the display form thereof.

The server computer may not include the simulator compiler 322A, and mayreceive the first control program 340 generated at the client computer.

By configuring the server computer to include a simulator andcalibration data, and perform the estimated execution time calculationprocess for a plurality of client computers, work for adding a newsimulator and calibration data suitable for a new model of controllercan be easier.

The controller support apparatus shown in FIG. 11 includes aconfiguration of the controller support apparatus C shown in FIG. 7, andin addition, includes at least the configurations described below. Thatis, the storage unit is further used for storing the first controlprogram 340, and the controller support program 320 further causes theoperation unit to execute a process of causing the controller supportapparatus to function as the simulator 324A and a process of measuringthe first control execution time by executing the first control program340 by the simulator 324A.

The embodiments disclosed herein are meant to be in all aspectsillustrative and not limiting. The scope of the disclosure is defined bythe appended claims, rather than by the above explanations, and allequivalents and modifications to the claims are included in the scope ofthe disclosure.

INDEX TO THE REFERENCE NUMERALS

1 . . . PLC, 2 . . . field network, 3 . . . servo motor drivers, 4 . . .servo motors, 5 . . . remote IO terminal, 6 . . . detection switch, 7 .. . relay, 8 . . . controller support apparatus, 9 . . . CD-ROM, 10 . .. connection cable, 11 . . . PLC system bus, 12 . . . power supply unit,13 . . . CPU unit, 14, 53 . . . IO units, 15 . . . special unit, 51 . .. remote IO terminal bus, 52 . . . communication coupler, 81 . . . CPU,82 . . . ROM, 83 . . . RAM, 84 . . . hard disk, 85 . . . keyboard, 86 .. . mouse, 87 . . . monitor, 88 . . . CD-ROM drive, 100 . . .microprocessor, 102 . . . chip set, 104 . . . main memory, 106 . . .non-volatile memory, 108 . . . system timer, 110 . . . USB connector,120 . . . PLC system bus controller, 122 . . . DMA control circuit, 124. . . PLC system bus control circuit, 126, 146 . . . buffer memory, 130. . . connector, 140 . . . field network controller, 142 . . . DMAcontrol circuit, 144 . . . field network control circuit, 200 . . .real-time OS, 210 . . . system program, 212 . . . scheduler program, 214. . . output process program, 216 . . . input process program, 218 . . .IO process program, 220 . . . other system programs, 230 . . . userprogram, 230 . . . control program, 232 . . . sequence command operationprogram, 234 . . . motion operation program, 236 . . . user program, 320. . . controller support program, 321 . . . editor program, 322 . . .compiler program, 322A, 380 . . . simulator compiler, 322B, 382 . . .controller compiler, 323 . . . debugger program, 324 . . . simulatorprogram, 324A . . . simulator, 325 . . . calibration data calculationprogram, 325A . . . calibration data calculation program, 326 . . .estimated execution time calculation program, 326A . . . estimatedexecution time calculation program, 327 . . . output program, 327A . . .output unit, 328 . . . communication program, 330 . . . control sourceprogram, 340 . . . first control program, 342 . . . second controlprogram, 370 . . . test source program, 390 . . . first test program,392 . . . second test program, SYS . . . system

What is claimed is:
 1. A controller support apparatus, comprising: astorage that stores a controller support program and calibration datarepresenting a relationship between a first test execution time and asecond test execution time; and a processor, wherein the first testexecution time comprises an execution time of a first test program whichis an object program generated from a test source program and operatingat a simulator of a controller, and the first test execution time ismeasured at the simulator, the second test execution time is anexecution time of a second test program which is an object programgenerated from the test source program and operating at the controller,and the second test execution time is measured at the controller, andthe controller support program causes the processor to execute:acquiring a first control execution time which is an execution time of afirst control program which is an object program generated from acontrol source program, which is a source program of a control programgenerated in accordance with an object of control of a user, andoperating at the simulator, and the first control execution time ismeasured at the simulator; calculating an estimated execution time whichis an estimated value of an execution time, at the controller, of asecond control program which is an object program generated from thecontrol source program and operating at the controller, by convertingthe first control execution time using the calibration data; andoutputting data representing the estimated execution time.
 2. Thecontroller support apparatus according to claim 1, wherein the storagestores the first control program, and the controller support programfurther causes the processor to execute: causing the controller supportapparatus to function as the simulator; and measuring the first controlexecution time by executing the first control program at the simulator.3. The controller support apparatus according to claim 2, wherein thecontroller support apparatus further comprises a display, the storagestores the first test program and the second test execution time, thecontroller support program further causes the processor to execute:measuring the first test execution time by executing the first testprogram at the simulator; and calculating the calibration data from thefirst test execution time and the second test execution time, and theprocess for outputting data representing the estimated execution timecomprises generating display data for causing the display to display theestimated execution time.
 4. A non-transitory computer readable storagemedium storing a controller support program that allows a computerapparatus to estimate control program execution time, the programallowing the computer apparatus to perform: acquiring a first controlexecution time comprising an execution time of a first control programwhich is an object program generated from a control source program,which is a source program of a control program generated in accordancewith an object of control of a user, and operating at a simulator, thefirst control execution time being measured at the simulator;calculating an estimated execution time comprising an estimated value ofan execution time, at a controller, of a second control program which isan object program generated from the control source program andoperating at the controller, by converting the first control executiontime using calibration data representing a relationship between a firsttest execution time a second test execution time; and outputting datarepresenting the estimated execution time, wherein the first testexecution time is an execution time of a first test program which is anobject program generated from a test source program and operating at asimulator of the controller, and the first test execution time ismeasured at the simulator, the second test execution time is anexecution time of a second test program which is an object programgenerated from the test source program and operating at the controller,and the second test execution time is measured at the controller.
 5. Thenon-transitory computer readable storage according to claim 4, whereinthe storage stores the first control program, and the controller supportprogram further causes the computer apparatus to perform: causing thecontroller support apparatus to function as the simulator; and measuringthe first control execution time by executing the first control programat the simulator.
 6. The non-transitory computer readable storageaccording to claim 5, wherein the storage stores the first test programand the second test execution time, and the controller support programfurther causes the computer apparatus to perform: measuring the firsttest execution time by executing the first test program at thesimulator; and calculating the calibration data from the first testexecution time and the second test execution time.
 7. A method ofestimating an execution time of a control program of a controllercontrolling an object to be controlled, the method being operated by acontroller support apparatus, the controller support apparatuscomprising: a storage that stores a controller support program andcalibration data representing a relationship between a first testexecution time and a second test execution time; and a processor,wherein the first test execution time comprises an execution time of afirst test program which is an object program generated from a testsource program and operating at a simulator of a controller, and thefirst test execution time is measured at the simulator, the second testexecution time is an execution time of a second test program which is anobject program generated from the test source program and operating atthe controller, and the second test execution time is measured at thecontroller; and the method comprising: acquiring a first controlexecution time which is an execution time of a first control programwhich is an object program generated from a control source program,which is a source program of a control program generated in accordancewith an object of control of a user, and operating at the simulator andthe first control execution time is measured at the simulator;calculating an estimated execution time which is an estimated value ofan execution time, at the controller, of a second control program whichis an object program generated from the control source program andoperating at the controller, by converting the first control executiontime using the calibration data; and outputting data representing theestimated execution time.